﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace TeamCommunitySolution.Domain.DataLayer.Base
{
    /// <summary>
    /// Tema Invite object.
    /// </summary>
    [Serializable]
    public class TeamInvite
    {
        /// <summary>
        /// Gets or sets the id.
        /// </summary>
        /// <value>The id of the instance.</value>
        public virtual string Id { get; set; }

        /// <summary>
        /// Gets or sets the team to join.
        /// </summary>
        /// <value>The team to join.</value>
        public virtual Team TeamToJoin { get; set; }

        /// <summary>
        /// Gets or sets the personal message.
        /// </summary>
        /// <value>The personal message.</value>
        public virtual string PersonalMessage { get; set; }

        /// <summary>
        /// Gets or sets the date created.
        /// </summary>
        /// <value>The date created.</value>
        public virtual DateTime DateCreated { get; set; }

        /// <summary>
        /// Gets or sets the user from.
        /// </summary>
        /// <value>The user from.</value>
        public virtual SystemUser UserFrom { get; set; }

        /// <summary>
        /// Gets or sets the user to.
        /// </summary>
        /// <value>The user to.</value>
        public virtual SystemUser UserTo { get; set; }

        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        /// <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">
        /// The <paramref name="obj"/> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            if (!(obj is TeamInvite))
            {
                return false;
            }

            TeamInvite other = obj as TeamInvite;

            return other.Id == this.Id;
        }

        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
        /// </returns>
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
